package com.lizhenhua.api.controller;

import com.lizhenhua.api.service.UserRegistService;
import com.lizhenhua.fmmall.beans.Users;
import com.lizhenhua.fmmall.vo.ResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@CrossOrigin // 跨域
@RequestMapping("/user")
public class UserRegistController {
    @Autowired
    private UserRegistService userResgit;

    @PostMapping("/regist")
    // 如果参数是一个对象 那么我们应该在实体类中添加注解
    public ResultVo regist(@RequestBody Users users) {
        ResultVo resultVo = userResgit.userResgit(users.getUsername(), users.getPassword());
        return resultVo;
    }

}
